﻿using Architecture.Api.Application.Commands.ImmuneInFormationCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domain.TraceabilityManage;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.ImmuneInFormationHandler
{
    public class ImmuneInFormationQueryCommandHandler : IRequestHandler<ImmuneInFormationQueryCommand, List<ImmuneInFormation>>
    {
        private readonly ICultureService _cultureService;

        public ImmuneInFormationQueryCommandHandler(ICultureService cultureService)
        {
            _cultureService = cultureService;
        }

        public async Task<List<ImmuneInFormation>> Handle(ImmuneInFormationQueryCommand request, CancellationToken cancellationToken)
        {
            return await _cultureService.GetImmuneInFormationList(request.productionLot);
        }
    }
}
